import request from '../utils/request';
// 用户列表接口
export const getUserListApi = (params) => request({
  url: 'users',
  params,
});
// 删除用户
export const delUserApi = (id) => request({
  url: `users/${id}`,
  method: 'delete',
});
// 新增用户
export const addUserApi = (data) => request({
  url: 'users',
  method: 'post',
  data,
});
// 编辑用户
export const editUserApi = (id, data) => request({
  url: `users/${id}`,
  method: 'put',
  data,
});
// 根据id获取用户信息
export const userInfoApi = (id) => request({
  url: `users/${id}`,
});
// 修改用户状态
export const UserStateApi = (id, type) => request({
  url: `users/${id}/state/${type}`,
  method: 'put',
});
// 修改用户角色
export const UserRoleApi = (id, data) => request({
  url: `users/${id}/role`,
  method: 'put',
  data,
});
